<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>伪类和伪元素选择器</title>
    <style>
        body {
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
        }

        main {
            padding: 2rem;
            width: 1200px;
            background-color: #EEEEEE;
        }

        main div {
            margin-left: 1rem;
        }

        main a,
        main input {
            font-size: 24px;
            font-weight: bold;
            line-height: 36px;
        }

        a:link {
            color: red
        }

        a:visited {
            color: green
        }

        a:hover {
            color: blue
        }

        a:active {
            color: yellow
        }

        input:focus {
            background-color: #339933;
        }

        input:hover {
            background-color: #FF0033;
        }

        input:active {
            background-color: #00CCFF;
        }
    </style>
</head>

<body>
    <main>
        <h1>伪类和伪元素选择器</h1>
        <h2 name="houdunren">h2元素</h2>
        <div>
            <h3>后盾人编程</h3>
            <aside>
                <h2 name="houdunren web">aside元素中的孙级元素h2</h2>
                <input type="text" placeholder="请输入关键字">
            </aside>
            <h2>h2孙级元素</h2>
        </div>
        <a href="https://www.houdunren.com" target="_blank">后盾人网站</a>
        <h1>h1兄弟元素</h1>
        <h2>h2兄弟元素</h2>
    </main>
</body>

</html>